<!DOCTYPE html>
<html>
    <head>
        <meta charset="utf-8">
        <meta content="width=device-width,initial-scale=1.0,maximum-scale=1.0,user-scalable=no" name="viewport">
        <meta content="yes" name="apple-mobile-web-app-capable">
        <meta content="black" name="apple-mobile-web-app-status-bar-style">
        <meta content="telephone=no" name="format-detection">
        <meta content="email=no" name="format-detection">
        <title>淘嘟嘟730大促</title>
        <link rel="stylesheet" type="text/css" href="__CSS__/common.css"/>
        <link rel="stylesheet" type="text/css" href="__CSS__/layout.css"/>
        <script type="text/javascript" src="__JS__/jquery-1.8.3.min.js"></script>
        <script type="text/javascript" src="__JS__/remSize.js"></script>
        <script src="__JS__/awardRotate.js"></script>
        <script type="text/javascript" src="__JS__/layer.js"></script>
        <script>
            $(function () {
                var rotateTimeOut = function () {
                    $('#rotate').rotate({
                        angle: 0,
                        animateTo: 2160,
                        duration: 8000,
                        callback: function () {
                            alert('网络超时，请检查您的网络设置！');
                        }
                    });
                };
                var bRotate = false;

                var rotateFn = function (awards, angles, txt) {
                    bRotate = !bRotate;
                    $('#rotate').stopRotate();
                    $('#rotate').rotate({
                        angle: 0,
                        animateTo: angles + 1800,
                        duration: 8000,
                        callback: function () {
                            layer.open({
                                content: txt
                            });
                            bRotate = !bRotate;
                        }
                    })
                };

                $('.pointer').click(function () {
                    if (bRotate)
                        return;
                    $.get('wheelApi','id=1', function (data) {
                        switch (data * 1) {
                            case 1:
                                rotateFn(1, 22, '<div class="prize">恭喜您获得</div></br>10元平台无门槛现金券<div class="wechat"><img src="images/10ywmk.png" /><p>二维码仅限本人一分钟内扫描领取</p></div>');
                                $(".chance span").html($(".chance span").html() * 1 - 1);
                                break;
                            case 3:
                                rotateFn(3, 250, '<div class="prize">恭喜您获得</div></br>2元现金券<div class="wechat"><img src="images/2ywmk.jpg" /><p>二维码仅限本人一分钟内扫描领取</p></div>');
                                $(".chance span").html($(".chance span").html() * 1 - 1);
                                break;
                            case 5:
                                rotateFn(5, 160, '<div class="prize">恭喜您获得</div></br>满50减20元券<div class="wechat"><img src="images/20yyh.jpg" /><p>二维码仅限本人一分钟内扫描领取</p></div>');
                                $(".chance span").html($(".chance span").html() * 1 - 1);
                                break;
                            case 4:
                                rotateFn(4, 68, '<div class="prize">恭喜您获得</div></br>满10减5元券<div class="wechat"><img src="images/5yyh.jpg" /><p>二维码仅限本人一分钟内扫描领取</p></div>');
                                $(".chance span").html($(".chance span").html() * 1 - 1);
                                break;
                            case 8:
                                rotateFn(8, 338, '<div class="prize">错过了奖品，不能错过好货！来淘嘟嘟畅快购！</div>');
                                break;
                            case 2:
                                rotateFn(2, 205, '<div class="prize">恭喜您获得</div></br>1元现金');
                                $(".chance span").html($(".chance span").html() * 1 - 1);
                                break;
                            case 401:
                                alert('您的抽奖机会已经用完！');
                                break;
                            case 402:
                                alert('您还未登录，请登录后再操作！');
                                window.location.href = '../mobile/user.php';
                                break;
                            case 403:
                                alert('活动已经结束！');
                                break;
                            case 404:
                                alert('今天抽奖还未开始哦，请10点以后再来！');
                                break;
                            case 406:
                                alert('今天抽奖已经结束喽，明天还有哦！');
                                break;
                            default:
                                rotateFn(8, 338, '<div class="prize">淘嘟嘟粉丝节!</div>');
                                break;
                        }
                    });
                });
            });
        </script>
    </head>
    <body>
        <section class="banner">
            <img src="__IMG__/wheel/banner_img.jpg"/>
        </section>
        <section class="wrapper-table">
            <article class="turntable-bg">
                <div class="pointer"><img src="__IMG__/wheel/pointer.png" alt="pointer"/></div>
                <div class="rotate"><img id="rotate" src="__IMG__/wheel/rotate.png" alt="turntable"/></div>
            </article>
            <article class="text-info">
                <div class="chance">您还有&nbsp;<span>1</span>&nbsp;次抽奖机会</div>
                <a class="btn" href="#enter">再来一次</a>
            </article>
        </section>
        <section class="rule">
            <img src="__IMG__/wheel/rule_img.jpg"/>
        </section>
        <section class="main">
            <div class="title">（7月26日-31日）</div>
            <a href="http://www.taodudu.com/mobile/topic.php?topic_id=25" class="wrap" id="enter">
                <img src="__IMG__/wheel/pro_img1.jpg"/>
            </a>
            <a href="http://www.taodudu.com/mobile/topic.php?topic_id=27" class="wrap">
                <img src="__IMG__/wheel/pro_img2.jpg"/>
            </a>
            <a href="http://www.taodudu.com/mobile/topic.php?topic_id=30" class="wrap">
                <img src="__IMG__/wheel/pro_img3.jpg"/>
            </a>
            <a href="http://www.taodudu.com/mobile/topic.php?topic_id=28" class="wrap">
                <img src="__IMG__/wheel/pro_img4.jpg"/>
            </a>
            <a href="http://www.taodudu.com/mobile/topic.php?topic_id=29" class="wrap">
                <img src="__IMG__/wheel/pro_img5.jpg"/>
            </a>
            <a href="http://www.taodudu.com/mobile/topic.php?topic_id=26" class="wrap">
                <img src="__IMG__/wheel/pro_img6.jpg"/>
            </a>
        </section>
        <footer>
            © 2014-2016 淘嘟嘟 版权所有，并保留所有权利。 河南省电子商务产业园 Tel:400-0371-775
        </footer>
    </body>
</html>